local awful = require("awful")
local beautiful = require("beautiful")
local bl = require("widgets.bluetooth")
local wifi = require("widgets.wifi")

-- Create a launcher widget and a main menu
myawesomemenu = {
   { "edit config", editor_cmd .. " " .. awesome.conffile },
   { "restart", awesome.restart },
}

exit_menu = {
   { "Power off", function() awful.spawn("shutdown now") end },
   { "Reboot", function() awful.spawn("shutdown -r now") end },
   { "Suspend", function()
         awful.spawn("systemctl suspend")
         awful.spawn(LOCKER)
   end },
   { "Quit Awesome", function() awesome.quit() end },
 }

monitors = {
    { "Auto", function() awful.spawn("xrandr --auto") end },
    { "eDP1 -- HDMI1", function() awful.spawn("xrandr --output HDMI1 --auto --right-of eDP1") end },
}

power_menu = {
    { "Performance", function() awful.spawn("powerprofilesctl set performance") end },
    { "Balanced", function() awful.spawn("powerprofilesctl set balanced") end },
    { "Power saver", function() awful.spawn("powerprofilesctl set power-saver") end },
}

mylauncher = awful.widget.launcher({
    image = beautiful.awesome_icon,
    menu = mymainmenu
})

mymainmenu = awful.menu({
    items = {
        { "awesome", myawesomemenu, beautiful.awesome_icon },
        { "logout",  exit_menu },
        { "power", power_menu },
        { "monitors", monitors },
        { "open terminal", terminal }
    }
})
